import layoutTest.FillLayoutTest;
import layoutTest.FormLayoutTest;
import layoutTest.GridLayoutTest;
import layoutTest.GridLayoutTest2;
import layoutTest.RowLayoutTest;
import menu.PopupMenuTest;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Layout;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;

import dialog.Dialogs;

import treeandlist.TreeTest;
import treeandlist.TreeViewerTest;


public class MainTab extends Composite
{

	
	
	public MainTab(Composite parent) 
	{
		super(parent, SWT.NONE);
		
		try
		{
			initComposite(parent);
			
			
			
		}
		catch (Exception e) 
		{
			
		}
		finally
		{
			
		}
		
	}
	
	private void initComposite(Composite parent)
	{
		Layout layout = null;
		
		TabFolder tabFolder 			= null;
		
		FillLayoutTest fillLayoutTest 	= null;
		TabItem fillLayoutTab 			= null;
		
		RowLayoutTest rowLayoutTest 	= null;
		TabItem rowLayoutTab 			= null;
		
		GridLayoutTest gridLayoutTest	= null;
		TabItem gridLayoutTab 			= null;
		
		GridLayoutTest2 gridLayoutTest2	= null;
		TabItem gridLayoutTab2			= null;
		
		
		FormLayoutTest formLayoutTest	= null;
		TabItem formLayoutTab			= null;
		
		TreeTest treeTest				= null;
		TabItem treeTab					= null;
		
		TreeViewerTest treeViewerTest	= null;
		TabItem treeViewerTab			= null;
		
		Dialogs dialogs					= null;
		TabItem dialogsTab				= null;
		
		try
		{
			layout = new FillLayout();
			this.setLayout(layout);
			
			tabFolder = new TabFolder(this, SWT.BORDER);
			
			//FillLayoutTest
			fillLayoutTest = new FillLayoutTest(tabFolder);
			
			fillLayoutTab = new TabItem(tabFolder, SWT.NONE);
			fillLayoutTab.setText("FillLayout");
			fillLayoutTab.setControl(fillLayoutTest);
			
			//RowLayoutTest
			rowLayoutTest = new RowLayoutTest(tabFolder);
			
			rowLayoutTab = new TabItem(tabFolder, SWT.NONE);
			rowLayoutTab.setText("RowLayout");
			rowLayoutTab.setControl(rowLayoutTest);
			
			//GridLayoutTest
			gridLayoutTest = new GridLayoutTest(tabFolder);
			
			gridLayoutTab = new TabItem(tabFolder, SWT.NONE);
			gridLayoutTab.setText("GridLayout");
			gridLayoutTab.setControl(gridLayoutTest);
			
			//GridLayoutTest2
			gridLayoutTest2 = new GridLayoutTest2(tabFolder);
			
			gridLayoutTab2 = new TabItem(tabFolder, SWT.NONE);
			gridLayoutTab2.setText("GridLayout2");
			gridLayoutTab2.setControl(gridLayoutTest2);
			
			//FormLayoutTest
			formLayoutTest = new FormLayoutTest(tabFolder);
			
			formLayoutTab = new TabItem(tabFolder, SWT.NONE);
			formLayoutTab.setText("FormLayoutTest");
			formLayoutTab.setControl(formLayoutTest);
			
			//TreeTest
			treeTest = new TreeTest(tabFolder);
			
			treeTab = new TabItem(tabFolder, SWT.NONE);
			treeTab.setText("TreeTest");
			treeTab.setControl(treeTest);
			
			//TreeViewerTest
			treeViewerTest = new TreeViewerTest(tabFolder);
			
			treeViewerTab = new TabItem(tabFolder, SWT.NONE);
			treeViewerTab.setText("TreeViewer");
			treeViewerTab.setControl(treeViewerTest);
			
			//Dialogs
			dialogs = new Dialogs(tabFolder);
			
			dialogsTab = new TabItem(tabFolder, SWT.NONE);
			dialogsTab.setText("Dialogs");
			dialogsTab.setControl(dialogs);
			
			
			
			
			tabFolder.setSelection(dialogsTab);
			tabFolder.pack();
			
			
			new PopupMenuTest(tabFolder); 

			
			this.pack();
			
		}
		catch (Exception e) 
		{
			
		}
		finally
		{
			
		}
	}

}
